package com.mingshashan.building.easy.core.service;

import com.mingshashan.building.easy.core.common.EasyPage;
import com.mingshashan.building.easy.core.common.PageRequest;
import com.mingshashan.building.easy.core.vo.PositionCreationVO;
import com.mingshashan.building.easy.core.vo.PositionUpdateVO;
import com.mingshashan.building.easy.core.vo.PositionVO;

/**
 * IPositionService
 *
 * @author jasonxu
 */
public interface IPositionService {

    /**
     * add position
     *
     * @param positionCreationVO
     * @return
     */
    PositionVO add(PositionCreationVO positionCreationVO);

    /**
     * delete position by id
     *
     * @param id
     */
    void delete(long id);

    /**
     * update position by id
     *
     * @param id
     * @param positionUpdateVO
     * @return
     */
    PositionVO update(long id, PositionUpdateVO positionUpdateVO);

    /**
     * get position by id
     *
     * @param id
     * @return
     */
    PositionVO getById(long id);

    /**
     * get position by code
     *
     * @param code
     * @return
     */
    PositionVO getByCode(String code);

    /**
     * search positions
     *
     * @param code
     * @param name
     * @param pageRequest
     * @return
     */
    EasyPage<PositionVO> searchPositions(String code, String name, PageRequest pageRequest);
}
